package jdbc;

import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DriverManager;

public class CallableStmt {
	public static void main(String[] args) {

		try {
			Class.forName("oracle.jdbc.driver.OracleDriver");
			Connection con = DriverManager.getConnection(
					"jdbc:oracle:thin:@10.23.245:1521:orcl", "scott", "tiger");
			System.out.println("Driver Connected successfully.");

			CallableStatement cstmt = con.prepareCall("{ call myprod4}");
			cstmt.executeUpdate();

			cstmt.close();
			con.close();
		} catch (Exception e) {
			System.out.println(e.toString());
		}
	}
}

/*
 * create procedure myprod4
 * 
 * AS
 * 
 * BEGIN
 * 
 * INSERT into MyTable values(4,'Veena',18000);
 * 
 * DBMS_OUTPUT.PUT_LINE('Value inserted');
 * 
 * END;
 * 
 * /
 */

